package cn.quevo.cube.provide.define.service.impl;

import cn.quevo.common.entity.PageResult;
import cn.quevo.cube.provide.define.dao.CubeColumnTypeDao;
import cn.quevo.cube.provide.define.entity.CubeColumnType;
import cn.quevo.cube.provide.define.entity.query.CubeColumnTypeQuery;
import cn.quevo.cube.provide.define.service.CubeColumnTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 字段类型 Service接口实现
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2018/12/11 14:57:03
 * @Copyright 东方浩星（北京）传媒科技有限公司版权所有.All Rights Reserved.
 */
@Service("cubeColumnTypeService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class CubeColumnTypeServiceImpl implements CubeColumnTypeService {
    @Resource(name="cubeColumnTypeDao")
    private CubeColumnTypeDao cubeColumnTypeDao;

    @Override
    public Map<String,Object> getSinge(CubeColumnTypeQuery cubeColumnTypeQuery) {
        return this.cubeColumnTypeDao.getSinge(cubeColumnTypeQuery);
    }

    @Override
    public Integer create(CubeColumnType cubeColumnType) {
        cubeColumnType.validateCreate();
        return this.cubeColumnTypeDao.create(cubeColumnType);
    }

    @Override
    public Integer update(CubeColumnType cubeColumnType) {
        cubeColumnType.validateUpdate();
        return this.cubeColumnTypeDao.update(cubeColumnType);
    }

    @Override
    public PageResult<Map<String,Object>> getPage(CubeColumnTypeQuery cubeColumnTypeQuery) {
        return this.cubeColumnTypeDao.getPage(cubeColumnTypeQuery);
    }
}
